package com.stone.customer.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.util.Date;

/**
 * 用户信息表o2vip_customer
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@VersionAudit
@ModifyAudit
@Table(name = "o2vip_customer")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Customer {

    public static final String FIELD_CUSTOMER_ID = "customerId";
    public static final String FIELD_CUSTOMER_NAME = "customerName";
    public static final String FIELD_MOBILE_NUMBER = "mobileNumber";
    public static final String FIELD_NICK_NAME = "nickName";
    public static final String FIELD_BLACK_LIST_FLAG = "blackListFlag";
    public static final String FIELD_REMARK = "remark";
    public static final String FIELD_EMAIL = "email";
    public static final String FIELD_GENDER = "genderCode";
    public static final String FIELD_BIRTH_DATE = "birthDate";
    public static final String FIELD_CHANNEL_TYPE_CODE = "channelTypeCode";
    public static final String FIELD_LAST_LOGIN_DATE = "lastLoginDate";
    public static final String FIELD_HZERO_CUSTOMER_ID = "hzeroUserId";
    public static final String FIELD_STATUS_CODE = "statusCode";
    public static final String FIELD_REGISTER_DATE = "registerDate";
    public static final String FIELD_CUSTOMER_CODE = "customerCode";
    public static final String FIELD_IS_ES_FLAG = "isEsFlag";
    public static final String FIELD_CUSTOMER_CATEGORY = "customerCategory";
    public static final String FIELD_ORIGINAL_CODE = "originalCode";
    public static final String FIELD_CREATE_DATE = "createDate";
    public static final String FIELD_UPDATE_DATE = "updateDate";
    public static final String FIELD_FIRST_ORDER_DATE = "firstOrderDate";
    public static final String FIELD_LRP = "lrp";
    public static final String FIELD_IS_LRP = "isLrp";
    public static final String FIELD_LRP_JOIN_DATE = "lrpJoinDate";
    public static final String FIELD_LRP_CREATE_DATE = "lrpCreateDate";
    public static final String FIELD_LAST_ORDER_DATE = "lastOrderDate";
    public static final String FIELD_INACTIVITY_DATE = "inactivityDate";
    public static final String FIELD_END_DATE = "endDate";
    public static final String FIELD_EST_TERMINATE_DATE = "estTerminateDate";
    public static final String FIELD_EXTERNAL_ID = "externalId";
    public static final String FIELD_ADDRESS = "address";
    public static final String FIELD_DATE_OF_EXPIRY = "dateOfExpiry";
    public static final String FIELD_CURRENT_RANK = "currentRank";
    public static final String FIELD_CURRENT_RANK_DATE = "currentRankDate";
    public static final String FIELD_MAX_RANK = "maxRank";
    public static final String FIELD_CONSECUTIVE_MONTHS = "consecutiveMonths";
    public static final String FIELD_TS_TYPE = "tsType";
    public static final String FIELD_TS_TYPE_STATUS = "tsTypeStatus";
    public static final String FIELD_CHANNEL = "channel";
    public static final String FIELD_SOCIAL_ID_TYPE = "socialIdType";
    public static final String FIELD_SOCIAL_ID_CODE = "socialIdCode";
    public static final String FIELD_CUSTOMER_STATUS = "customerStatus";
    public static final String FIELD_RECOMMEND_CODE = "recommendCode";
    public static final String FIELD_SPONSOR_CODE = "sponsorCode";
    public static final String FIELD_MARKET = "market";
    public static final String FIELD_BIRTHDAY = "birthday";
    public static final String FIELD_LRP_TIMES = "lrpTimes";
    public static final String FIELD_CONTIMONTH_TIMES = "contimonthTimes";
    public static final String FIELD_CONTIMONTH_STATUS = "contimonthStatus";
    public static final String FIELD_CONTIMONTH_CALC_STATUS = "contimonthCalcStatus";
    public static final String FIELD_CONTIMONTH_CALC_DATE = "contimonthCalcDate";
    public static final String FIELD_BLACK_LIST = "blackList";
    public static final String FIELD_AM = "am";
    public static final String FIELD_OPERATOR = "operator";
    public static final String FIELD_SA_APPLICATION_DATE = "saApplicationDate";
    public static final String FIELD_VIPBIZ_APPLICATION_DATE = "vipbizApplicationDate";
    public static final String FIELD_CACNO = "cacno";
    public static final String FIELD_CUSTOMER_NAME2 = "customerName2";
    public static final String FIELD_LRP_PRECENTAGE = "lrpPrecentage";
    public static final String FIELD_DOCUMENT_STATUS = "documentStatus";
    public static final String FIELD_CREATE_STATUS = "createStatus";
    public static final String FIELD_LRP_END_DATE = "lrpEndDate";
    public static final String FIELD_ST_DATE = "stDate";
    public static final String FIELD_EFFECTIVE_DATE = "effectiveDate";
    public static final String FIELD_PASS_US_FILE_NAME = "passUsFileName";
    public static final String FIELD_SOCIAL_ID_STATUS = "socialIdStatus";
    public static final String FIELD_RECOMMEND_GAC = "recommendGac";
    public static final String FIELD_SPONSOR_GAC = "sponsorGac";
    public static final String FIELD_OLD_RECOMMEND_CODE = "oldRecommendCode";
    public static final String FIELD_OLD_SPONSOR_CODE = "oldSponsorCode";
    public static final String FIELD_RECOMMEND_STATUS = "recommendStatus";
    //
    // 业务方法(按public protected private顺序排列)
    // ------------------------------------------------------------------------------

    //
    // 数据库字段
    // ------------------------------------------------------------------------------

    @Id
    @GeneratedValue
    @ApiModelProperty("表ID，主键，供其他表做外键")
    private Long customerId;

    @ApiModelProperty(value = "会员名")
    private String customerName;

    @ApiModelProperty(value = "手机号")
    private String mobileNumber;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "是否在黑名单")
    private Integer blackListFlag;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "邮件地址")
    private String email;

    @ApiModelProperty(value = "性别,,值集HPFM.GENDER")
    private String genderCode;

    @ApiModelProperty(value = "生日")
    private Date birthDate;

    @ApiModelProperty(value = "o2原有渠道")
    private String channelTypeCode;

    @ApiModelProperty(value = "最近一次登录时间")
    private Date lastLoginDate;

    @ApiModelProperty(value = "hzero会员")
    private Long hzeroUserId;

    @ApiModelProperty(value = "注册时间")
    private Date registerDate;


    @ApiModelProperty(value = "状态，取自值集O2VIP.STATUS_CODE")
    @NotBlank
    private String statusCode;

    @ApiModelProperty(value = "会员卡号")
    private String customerCode;

    @ApiModelProperty(value = "es更新标记")
    private Integer isEsFlag;
    @ApiModelProperty(value = "客户类别,值集：O2VIP.CUSTOMER_CATEGORY")
    private String customerCategory;
    @ApiModelProperty(value = "原客户编码")
    private String originalCode;
    @ApiModelProperty(value = "创建日期")
    private Date createDate;
    @ApiModelProperty(value = "更新日期")
    private Date updateDate;
    @ApiModelProperty(value = "首张有效订单日期")
    private Date firstOrderDate;
    @ApiModelProperty(value = "是否加入LRP")
    private Integer lrp;
    @ApiModelProperty(value = "LRP轻松购（是否）")
    private Integer isLrp;
    @ApiModelProperty(value = "加入LRP日期")
    private Date lrpJoinDate;
    @ApiModelProperty(value = "LRP轻松购创建日期")
    private Date lrpCreateDate;
    @ApiModelProperty(value = "最后一笔订单日期")
    private Date lastOrderDate;
    @ApiModelProperty(value = "不活动日期")
    private Date inactivityDate;
    @ApiModelProperty(value = "终止日期")
    private LocalDate endDate;
    @ApiModelProperty(value = "预计terminate时间")
    private Date estTerminateDate;
    @ApiModelProperty(value = "KJT客户号")
    private String externalId;
    @ApiModelProperty(value = "地址,关联o2vip_customer_address.address_id")
    private Long address;
    @ApiModelProperty(value = "证件有效期")
    private LocalDate dateOfExpiry;
    @ApiModelProperty(value = "当前职级,值集")
    private String currentRank;
    @ApiModelProperty(value = "当前职级日期")
    private Date currentRankDate;
    @ApiModelProperty(value = "历史最高职级,值集")
    private String maxRank;
    @ApiModelProperty(value = "连续满125PV月数")
    private String consecutiveMonths;
    @ApiModelProperty(value = "T/S渠道")
    private String tsType;
    @ApiModelProperty(value = "渠道值集")
    private String channel;
    @ApiModelProperty(value = "证件类型，值集：O2VIP.SOCIAL_ID_TYPE")
    private String socialIdType;
    @ApiModelProperty(value = "证件号码")
    private String socialIdCode;
    @ApiModelProperty(value = "客户状态值集：O2VIP.CUSTOMER_STATUS")
    private String customerStatus;
    @ApiModelProperty(value = "推荐人编码")
    private String recommendCode;
    @ApiModelProperty(value = "参考人编码")
    private String sponsorCode;
    @ApiModelProperty(value = "市场")
    private String market;
    @ApiModelProperty(value = "生日")
    private String birthday;
    @ApiModelProperty(value = "LRP次数")
    private String lrpTimes;
    @ApiModelProperty(value = "连续月次数")
    private String contimonthTimes;
    @ApiModelProperty(value = "连续月次数处理状态")
    private String contimonthStatus;
    @ApiModelProperty(value = "连续月次数计算状态")
    private String contimonthCalcStatus;
    @ApiModelProperty(value = "连续月次数计算时间")
    private Date contimonthCalcDate;

    @ApiModelProperty(value = "是否加入黑名单")
    private Integer blackList;
    @ApiModelProperty(value = "AM")
    private String am;
    @ApiModelProperty(value = "操作人")
    private String operator;
    @ApiModelProperty(value = "SA申请日期")
    private Date saApplicationDate;
    @ApiModelProperty(value = "Vip Biz申请日期")
    private Date vipbizApplicationDate;
    @ApiModelProperty(value = "CACNO")
    private String cacno;

    @ApiModelProperty(value = "客户名称2")
    private String customerName2;

    @ApiModelProperty(value = "LRP百分比")
    private String lrpPrecentage;
    @ApiModelProperty(value = "上传状态，值集O2MD.DOCUMENT_STATUS")
    private String documentStatus;

    @ApiModelProperty(value = "T/S渠道上传状态，值集值集O2MD.DOCUMENT_STATUS")
    private String tsTypeStatus;

    @ApiModelProperty(value = "生成状态，值集O2MD.DOCUMENT_STATUS")
    private String createStatus;

    @ApiModelProperty(value = "LRP结束日期")
    private Date lrpEndDate;

    @ApiModelProperty(value = "S/T时间")
    private Date stDate;
    @ApiModelProperty(value = "compliance信息")
    private String compliance;
    @ApiModelProperty(value = "生效日期")
    private Date effectiveDate;
    @ApiModelProperty(value = "OMS收到轻松购创建日期的时间")
    private Date lrpCreationDate;
    @ApiModelProperty(value = "账户经理跟进")
    private String amStatus;
    @ApiModelProperty("FastTrack赠点状态")
    private String fastTrackStatus;
    @ApiModelProperty("Loyalty计算状态，值集值集O2MD.DOCUMENT_STATUS")
    private String loyaltyStatus;
    @ApiModelProperty("同步美国文件DIST")
    private String passUsFileName;
    @ApiModelProperty("证件号码权限")
    private Integer socialIdStatus;
    @ApiModelProperty("推荐人GAC")
    private String recommendGac;
    @ApiModelProperty("参考人GAC")
    private String sponsorGac;
    @ApiModelProperty(value = "原始推荐人编码")
    private String oldRecommendCode;
    @ApiModelProperty(value = "原始参考人编码")
    private String oldSponsorCode;
    @ApiModelProperty(value = "原始参考人编码")
    private String recommendStatus;

    //
    // 非数据库字段
    // ------------------------------------------------------------------------------

    @ApiModelProperty(value = "客户类别含义")
    @Transient
    private String customerCategoryMeaning;
    @ApiModelProperty(value = "渠道类型含义")
    @Transient
    private String channelMeaning;
    @ApiModelProperty(value = "市场类型含义")
    @Transient
    private String marketMeaning;
    @ApiModelProperty(value = "证件类型含义")
    @Transient
    private String socialIdTypeMeaning;
    @ApiModelProperty(value = "客户状态含义")
    @Transient
    private String customerStatusMeaning;
    @ApiModelProperty(value = "上传状态含义")
    @Transient
    private String documentStatusMeaning;
    @ApiModelProperty(value = "T/S渠道上传状态含义")
    @Transient
    private String tsTypeStatusMeaning;
    @ApiModelProperty(value = "生成状态含义")
    @Transient
    private String createStatusMeaning;
    @ApiModelProperty(value = "Loyalty计算状态含义")
    @Transient
    private String loyaltyStatusMeaning;
    @ApiModelProperty(value = "性别含义")
    @Transient
    private String genderMeaning;
    @ApiModelProperty(value = "账户经理跟进含义")
    @Transient
    private String amStatusMeaning;
    @ApiModelProperty(value = "证件号码权限含义")
    @Transient
    private String socialIdStatusMeaning;
}